// logs.js
const util = require('../../utils/util.js')

Page({
  data: {
    logs: []
  },
  onShow(){
    var that = this;
    getApp().isLoginWatch(function(e){
      console.log("log页面收到了登录回调")
      console.log(e)
      var message = wx.getStorageSync('message') || []
      
      message.unshift(e)
      that.setData({
        logs: message.map(msg => {
          return {
            date: msg,
            timeStamp: msg
          }
        })
      })
    });
  },
  onLoad() {
    console.log(wx.getStorageSync('message'));

    this.setData({

      logs: (wx.getStorageSync('message') || []).map(msg => {
        return {
          date: msg,
          timeStamp: msg
        }
      })
    })
  }
})
